package k.b.s;

import java.io.InputStream;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;


public class HttpGetter{

	static public InputStream getContent(String url){
		DefaultHttpClient client = new DefaultHttpClient();
		HttpGet get = new HttpGet(url);
		InputStream in = null;
		try{
			HttpResponse res = client.execute(get);
			if(res.getStatusLine().getStatusCode() == HttpStatus.SC_OK){
				HttpEntity entity = res.getEntity();
				in=entity.getContent();
			}
		}catch(Exception e){
			e.printStackTrace();
		}
		return in;
	}
}